<template>
	<view class="profile">
		<view class="top">
			<view class="goBackButton" @click="goBack()">
				<image style="width: 100%;height: 100%;" src="../../static/icons/Iconly_Light_Arrow - Left@1x.png"
					mode="center">
				</image>
			</view>
		</view>


		<view class="profileContent">
			<view class="toptitle">
				My profile
			</view>


			<view class="avatorBox">
				<view class="avator">
					<image src="../../static/images/favorite/profile/avator.png" style="width: 100%;height: 100%;">
					</image>
				</view>
				<view class="avatorCard">
					<view class="username">
						Rosina Doe
					</view>

					<view class="location">
						<view class="locationIcon">
							<image src="../../static/icons/Iconly_Light_Location@1x.png"
								style="width: 100%;height: 100%;"></image>
						</view>

						<view class="locationContent">
							Address: 43 Oxford RoadM13 4GRManchester, UK
						</view>
					</view>
				</view>
			</view>


			<view class="profileItem">
				<view class="title">
					Edit Profile
				</view>
				<view class="icon">
					<image src="../../static/icons/chevron-left.png" style="width:100%;height: 100%;"></image>
				</view>
			</view>

			<view class="profileItem">
				<view class="title">
					Shopping address
				</view>
				<view class="icon">
					<image src="../../static/icons/chevron-left.png" style="width:100%;height: 100%;"></image>
				</view>
			</view>

			<view class="profileItem" @click="goOrderHistory()">
				<view class="title">
					Order history
				</view>
				<view class="icon">
					<image src="../../static/icons/chevron-left.png" style="width:100%;height: 100%;"></image>
				</view>
			</view>

			<view class="profileItem">
				<view class="title">
					Cards
				</view>
				<view class="icon">
					<image src="../../static/icons/chevron-left.png" style="width:100%;height: 100%;"></image>
				</view>
			</view>

			<view class="profileItem">
				<view class="title">
					Notifications
				</view>
				<view class="icon">
					<image src="../../static/icons/chevron-left.png" style="width:100%;height: 100%;"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	// 返回上一页
	const goBack = () => {
		uni.navigateBack()
	}
	// 跳转订单历史列表
	const goOrderHistory = () => {
		uni.navigateTo({
			url: '/pages/orderHistory/orderHistory'
		})
	}
</script>

<style lang="scss" scoped>
	.profile {
		width: 100vw;
		min-height: 100vh;
		height: 100%;
		background-color: rgba(246, 246, 249, 1);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: start;


		.top {
			margin-top: 120rpx;
			width: 100%;
			padding: 0 58rpx;
			display: flex;
			align-items: center;
			justify-content: flex-start;


			.goBackButton {
				width: 48rpx;
				height: 48rpx;
			}
		}

		.profileContent {
			margin-top: 80rpx;
			width: 100%;
			padding: 0 100rpx;
			display: flex;
			align-items: center;
			flex-direction: column;
			justify-content: center;
			gap: 40rpx;

			.toptitle {
				font-size: 68rpx;
				font-weight: 700;
				letter-spacing: 0px;
				line-height: 0px;
				color: rgba(0, 0, 0, 1);
				width: 100%;
				text-align: start;
				height: fit-content;
			}


			.avatorBox {
				margin-top: 50rpx;
				width: 100%;
				height: 380rpx;
				position: relative;

				.avator {
					width: 158rpx;
					height: 158rpx;
					border-radius: 50%;
					overflow: hidden;
					position: absolute;
					top: 0;
					left: 50%;
					transform: translateX(-50%);
					z-index: 99;
				}

				.avatorCard {
					width: 100%;
					height: 334rpx;
					border-radius: 40rpx;
					background: rgba(255, 255, 255, 1);
					box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.03);
					position: absolute;
					left: 0;
					bottom: 0;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: end;


					.username {
						font-size: 36rpx;
						font-weight: 600;
						letter-spacing: 0px;
						line-height: 21.13px;
						color: rgba(0, 0, 0, 1);
						width: 100%;
						text-align: center;
						margin-bottom: 24rpx;
					}

					.location {
						display: flex;
						align-items: start;
						justify-content: center;
						gap: 28rpx;
						margin-bottom: 34rpx;

						.locationIcon {
							width: 48rpx;
							height: 48rpx;
						}

						.locationContent {
							width: 364rpx;
							font-size: 30rpx;
							font-weight: 400;
							letter-spacing: 0px;
							line-height: 17.58px;
							color: rgba(0, 0, 0, 1);
							text-align: left;
						}
					}



				}
			}



			.profileItem {
				width: 100%;
				height: 120rpx;
				border-radius: 40rpx;
				background: rgba(255, 255, 255, 1);
				box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.03);
				padding: 0 46rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				&:active {
					opacity: 0.8;
				}

				.title {
					font-size: 36rpx;
					font-weight: 600;
					letter-spacing: 0px;
					line-height: 21.09px;
					color: rgba(0, 0, 0, 1);
				}

				.icon {
					width: 48rpx;
					height: 48rpx;
				}
			}
		}
	}
</style>